1. Field of the Invention
The present invention generally relates to digital video processing and, more particularly, to a method and apparatus for processing a bitstream in a digital video transcoder.
2. Description of the Related Art
Transcoding is an operation for converting a bitstream of one rate into another bitstream of a different rate. For example, the bitstream may represent compressed video data in accordance with an MPEG standard (Moving Pictures Expert Group), such as MPEG-2 as defined in ISO/IEC Standard 13818. A transcoder is typically employed to change the bit-rate of a previously encoded bitstream before transmission over a channel with insufficient bandwidth for supporting the initial bit-rate. That is, if the bandwidth of the transmission channel is narrower than the bit-rate of the bitstream, a transcoder may be employed to change the bit-rate to match the bandwidth of the channel.
It is known to employ an adaptive quantization level (AQL) algorithm within an encoder during the quantization process. One example of such an AQL algorithm is described in MPEG-2 Test Model 5 (TM5). AQL algorithms attempt to lower quantization noise in low activity areas, while taking bits away from high activity areas. It is advantageous to lower quantization noise in low activity areas, since compression artifacts are more noticeable in such low activity areas. In high activity areas, however, quantization noise may be hidden.
Some transcoders employ a re-quantization process to adjust the bit-rate of the input bitstream. Conventional AQL algorithms that are adapted for use during the encoding process do not work well in the re-quantization process of a transcoder. Notably, conventional AQL algorithms do not account for the fact that the input bitstream contains data that has already been quantized. When used in a transcoder, such algorithms may attempt to reduce the quantization level below that of the input quantization level. This will cause the output bitstream to have worse quality in the high-activity areas with no improvement in the low-activity areas.